package 面向对象初级.HomeWork;

//测试类
public class Employee01Test {
    public static void main(String[] args) {
        // 创建员工数组
        Employee01[] employees = new Employee01[5];

        // 创建5个员工对象并赋值
        for (int i = 0; i < 5; i++) {
            employees[i] = new Employee01();
            employees[i].setInfo(i + 1, "员工" + (i + 1), 5000 + i * 1000, 20 + i * 2);
        }

        // 创建员工管理对象
        EmployeeManager manager = new EmployeeManager();

        // 调用print方法显示员工信息
        System.out.println("初始员工信息:");
        manager.print(employees);

        // 调用sort方法对员工数组按照年龄排序并显示信息
        System.out.println("按照年龄排序后的员工信息:");
        manager.sort(employees);
        manager.print(employees);

        // 调用addSalary方法给员工加薪并显示信息
        System.out.println("加薪后的员工信息:");
        manager.addSalary(employees, 1000);
        manager.print(employees);
    }
}
